package com.tt.fashionWebSite.controller;

import com.tt.fashionWebSite.dto.JsonResponseCode;
import com.tt.fashionWebSite.dto.JsonResponseDto;
import com.tt.fashionWebSite.dto.LoaiDanhMucFullDto;
import com.tt.fashionWebSite.service.WomenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by isoft-work 5 on 12/6/2014.
 */
@Controller
public class WomenController {
   @Autowired
   private WomenService womenService;

   @SuppressWarnings("rawtypes")
   @RequestMapping(value = "/women/getListMenu/{gender}", method = RequestMethod.GET)
   public @ResponseBody
   JsonResponseDto<List<LoaiDanhMucFullDto>> getList(HttpServletRequest request, @PathVariable String gender) {
      return new JsonResponseDto<List<LoaiDanhMucFullDto>>(womenService.getListMenu(gender), JsonResponseCode.SUCCESS);
   }
}
